package com.tanhua.server.service;

import com.alibaba.dubbo.config.annotation.Reference;
import com.tanhua.common.pojo.User;
import com.tanhua.common.utils.UserThreadLocal;
import com.tanhua.dubbo.server.api.UserLocationApi;
import org.springframework.stereotype.Service;

/**
 * @Author 王加鑫
 * @Date 2021/09/14 21:24
 * @Since JDK 1.8
 */
@Service
public class BaiduService {

    @Reference(version = "1.0.0")
    private UserLocationApi userLocationApi;

    /**
     * 上传地理位置信息
     * @param latitude
     * @param longitude
     * @param addrStr
     * @return
     */
    public Boolean updateLocation(Double latitude, Double longitude, String addrStr) {
        User user = UserThreadLocal.get();
        return this.userLocationApi.updateUserLocation(user.getId(), longitude, latitude, addrStr);
    }
}
